<?php get_header(); ?>

<div id="content">
	
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

	<?php
	 
	if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
		$howto_trackback = 'You could <a href="'.trackback_url(false).'">Trackback</a> this post from your own site.';
	} elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
		$howto_trackback = 'Responses are currently closed, but you can <a href="'.trackback_url(false).'">Trackback</a> this post from your own site.';
	} elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
		$howto_trackback = 'You can skip to the end and leave a response. Pinging is currently not allowed.';
	} elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
		$howto_trackback = 'Sorry, Both comments and pings are currently closed.';	
	} else {
		$howto_trackback = 'BO!';
	}

	?> 

<div class="post single" id="post-<?php the_ID(); ?>">

	<div class="posthead">
		<h3 class="title"><a href="<?php the_permalink() ?>" rel="bookmark"
		title="Permanent Link to this post <?php the_title(); ?>"><?php the_title(); ?></a></h3>
		<div class="postmetadata">
		<span class="date"><small><span>Post date: </span><?php global $tatimefmt; the_time("$tatimefmt"); ?></small></span>
		<span class="author"><small><span> - by: </span><?php the_author() ?></small></span>
		<span class="categories"><small><span> - Posted in: </span><?php the_category(', ') ?></small></span>
		<?php edit_post_link('Edit','<span class="edit"><small>[',']</small></span>'); ?>
		</div>
	</div>

	<div class="entry">
		<?php the_content('<p class="more">Read the rest of this entry &raquo;</p>'); ?>
		<?php link_pages('<p id="morepages"><strong>Pages:</strong> ', '</p>', 'number'); ?>
	</div>

	<div class="extend"><hr />
	
		<p class="track"><?php echo $howto_trackback; ?></p>	

		<?php comments_template(); ?>
		
		<?php endwhile; else: ?>
		<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>

<?php endif; ?>
		</div><!--eof extend-->
	</div><!-- eof post -->

<?php ta_include('page-nav.php'); ?>

</div><!--eof content -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>